package com.videoshare.multimedia;

import java.sql.Connection;
import javax.servlet.http.*;

import org.apache.struts.action.*;
import org.apache.commons.logging.*;

import com.hp.hpl.jena.rdf.model.Model;
import com.sapientia.multimedia.dao.*;
import com.sapientia.rdfmodel.bean.*;

import java.util.*;

public class MimeTypeAction extends Action
{
	
	
	public ActionForward execute(
			ActionMapping mapping,
			ActionForm form,
			HttpServletRequest request,
			HttpServletResponse response) throws Exception
	{					
		
		HttpSession session = request.getSession();
		
		Connection conn = getDataSource(request,"userDB").getConnection();
		MultimediaDAO dao = new MultimediaDAOImpl(conn);
		MimeTypeBean bean  = dao.getMimeType();
		
		List videoList = bean.getVideoStreamMimeTypeList();
		List audioList = bean.getAudioStreamMimeTypeList();
		
		
		session.setAttribute("videoList",videoList);
		session.setAttribute("audioList",audioList);
		
		return mapping.findForward("success");
	}

}
